﻿using System.Linq.Expressions;
using Basic.HrModel.DB;
using Basic.HrModel.Dept;
using Basic.HrRemoteModel.Dept.Model;

namespace Basic.HrCollect
{
    public interface IDeptCollect
    {
        long[] GetSubDeptId ( long deptId );
        Result[] Gets<Result> ( DeptQueryParam query ) where Result : class, new();
        Result[] Gets<Result> ( long[] ids ) where Result : class, new();
        DeptBase[] GetUnitDepts ( UnitGetParam param );
        string GetDeptName ( long id );
        Dictionary<long, string> GetDeptName ( long[] ids );
        string[] GetDeptNameList ( long[] ids );
        long Add ( DeptAdd add );
        void Delete ( DBDept dept );
        bool Enable ( DBDept dept );
        bool Enable ( long[] deptId );
        DBDept Get ( long id );
        long[] GetEnableSubId ( DBDept dept );
        long[] GetAllSubUnitId ( DBDept dept );
        Result[] GetAllSub<Result> ( DBDept dept, Expression<Func<DBDept, Result>> selector );
        long[] GetSubDeptId ( long unitId, DBDept dept );
        Result[] GetDepts<Result> ( DeptGetParam param ) where Result : class, new();
        long[] GetEnableDeptId ( long unitId );
        bool Set ( DBDept dept, DeptSet set );
        bool Stop ( DBDept dept );
        Dictionary<long, string> GetDeptFullName ( long[] ids );
        void SetLeader ( DBDept dept, long? leaderId );
        long GetUnitId ( long deptId );
        KeyValuePair<long, long>[] GetUnitId ( long[] deptId );
        void ToVoidUnit ( long[] unitId );
        void ToVoidDept ( long[] deptId );
        string GetUnitDeptName ( long id );

        Dictionary<long, string> GetUnitDeptName ( long[] id );
        long[] GetLeaderId ( long[] ids );
        long? GetLeaderId ( long id );
        long GetParentId ( long id );
        long[] GetSubUnitId ( long unitId );
        Result Get<Result> ( long id ) where Result : class, new();
        long[] FindDeptId ( DeptFindParam param );
    }
}